Use common IRET macro for all exits from XenLinux. Currently
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 23 Feb 2006 17:40:08 +0000 (18:40 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 23 Feb 2006 17:40:08 +0000 (18:40 +0100)
uses slow iret path every time (but most returns will do that
anyway, since they'll be to userspace). Fast return (to kernel)
can be implemented inside the macro and respect the
supervisor_mode_kernel feature flag.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S

index 0ef077d66ed25b17f3e1ea29f17b71d1b1ee9ad0..c2733797b3e0684712b2730789d2059296cc636e 100644 (file)
@@ -325,7 +325,7 @@ ENTRY(int_ret_from_sys_call)
        testb $3,CS-ARGOFFSET(%rsp)
         jnz 1f
         /* Need to set the proper %ss (not NULL) for ring 3 iretq */
-        movl $__KERNEL_DS|3,SS-ARGOFFSET(%rsp)
+        movl $__KERNEL_DS,SS-ARGOFFSET(%rsp)
         jmp retint_restore_args   # retrun from ring3 kernel
 1:              
        movl $_TIF_ALLWORK_MASK,%edi
@@ -510,13 +510,7 @@ retint_restore_args:
        jnz restore_all_enable_events   # != 0 => reenable event delivery      
         XEN_PUT_VCPU_INFO(%rsi)
                
-       RESTORE_ARGS 0,8,0                                              
-       testb $3,8(%rsp)                # check CS
-       jnz  user_mode
-kernel_mode:
-        orb   $3,1*8(%rsp)
-       iretq
-user_mode:
+       RESTORE_ARGS 0,8,0
        HYPERVISOR_IRET 0
        
        /* edi: workmask, edx: work */
@@ -826,11 +820,6 @@ scrit:     /**** START OF CRITICAL REGION ****/
        jnz  14f                        # process more events if necessary...
        XEN_PUT_VCPU_INFO(%rsi)
         RESTORE_ARGS 0,8,0
-        testb $3,8(%rsp)                # check CS
-        jnz  crit_user_mode
-        orb   $3,1*8(%rsp)
-        iretq
-crit_user_mode:
         HYPERVISOR_IRET 0
         
 14:    XEN_LOCKED_BLOCK_EVENTS(%rsi)